<template lang="pug">
    skin(@up="up",@down="down",@yes="yes",@back="back")
        div(class="flex-column large-dose-common h3")
            div(class="flex-column-item flex-center-center under-line") 
                span --大剂量输注中---
            div(class="flex-column-item flex-center flex-2")
                i(class="iconfont", style="font-size:300%") &#xe600;
            div(class="flex-column-item center")
                span {{currentAmount}}U

    
</template>

<script>
export default {
  data() {
    return {
      currentAmount: 0,
      planAmount: 2,
      interval: null
    };
  },
  methods: {
    getActive(id) {
      return this.menus.find(menu => {
        return menu.id == id;
      });
    },
    up() {
      if (this.influsionPlan.amount < 20)
        this.influsionPlan.amount =
          (this.influsionPlan.amount * 10 + 0.1 * 10) / 10;
    },
    down() {
      if (this.influsionPlan.amount > 0)
        this.influsionPlan.amount =
          (this.influsionPlan.amount * 10 - 0.1 * 10) / 10;
    },

    back() {
      if (this.visible) this.visible = false;
      else this.$router.push("/large-dose/menu");
    },
    yes() {}
  },
  mounted() {
    var vm = this;
    var interval = setInterval(() => {
      if (vm.currentAmount < vm.planAmount)
        vm.currentAmount = (vm.currentAmount * 10 + 0.5 * 10) / 10;
      else {
        clearInterval(interval);
        vm.$router.push("/");
      }
    }, 1000);
  },
  beforeDestroy() {
    clearInterval(this.interval);
  }
};
</script>

<style lang="less">
</style>
